package com.baidu.basic;

import java.io.IOException;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import freemarker.core.Environment;
import freemarker.template.TemplateDirectiveBody;
import freemarker.template.TemplateDirectiveModel;
import freemarker.template.TemplateException;
import freemarker.template.TemplateModel;

public class CategoryListDirective implements TemplateDirectiveModel{
	
	/**
	 * 部署路径调用名称
	 */
	public static final String CONTEXT_PATH = "base";
	private HttpServletRequest request;
	
	@SuppressWarnings("rawtypes")
	@Override
	public void execute(Environment env, Map params, TemplateModel[] loopVars,
			TemplateDirectiveBody body) throws TemplateException, IOException {
		env.setCustomAttribute(CONTEXT_PATH, request.getContextPath());
        body.render(env.getOut());
	}
}

